import * as echarts from 'echarts'
// 柱状图
export const pillarOption = {
    grid: {
        top: '10px',
        left: '0',
        right: '0',
        bottom: '14px',
        containLabel: true
    },
    xAxis: {
        type: 'category',
        data: []
    },
    yAxis: {
        type: 'value'
    },
    series: [
        {
            itemStyle: {
                normal: { //显示渐变色颜色
                    color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                        { offset: 0, color: 'rgba(0, 224, 203, 1)' },
                        { offset: 1, color: 'rgba(91, 143, 249, 0.20)' }
                    ]),
                },
            },
            data: [],
            type: 'bar'
        }
    ]
};
// 饼图
export const pieOption = {

    series: [
        {
            name: 'Access From',
            type: 'pie',
            radius: ['50%', '80%'],
            avoidLabelOverlap: false,
            label: {
                show: false,
                position: 'center'
            },

            emphasis: {
                label: {
                    show: true,
                    fontSize: 12,
                    fontWeight: 'bold',
                    formatter: `{c}\n{b}`,
                    color: () => {
                    },
                    lineHeight: 20
                }
            },
            labelLine: {
                show: false
            },
            data: [
                // { value: 1048, name: '违规闯入' },
                // { value: 735, name: '反光衣' },
                // { value: 580, name: '安全帽' },
                // { value: 484, name: '人员下车' },
            ]
        }
    ]
}
// 折线图
export const categoryOptions = {
    grid: {
        top: '20px',
        left: '0',
        right: '0',
        bottom: '24px',
        containLabel: true
    },
    xAxis: {
        position: 'right',
        boundaryGap: true,
        axisTick: {
            show: false // 隐藏x轴刻度线
        },

        type: 'category',
        data: ['0:00', '2:00', '4:00', '6:00', '8:00', '10:00', '12:00', '14:00', '16:00', '20:00', '22:00', '24:00']
    },
    yAxis: {
        scale: true,
        boundaryGap: true,
        axisTick: {
            show: false // 隐藏x轴刻度线
        },
        axisLine: {
            show: false, // 隐藏Y轴实线
        },
        splitLine: {
            show: true, // 显示Y轴虚线

        },
        type: 'category',
        // eslint-disable-next-line no-dupe-keys
        boundaryGap: false,
        // data: [0, 20, 40, 60, 80, 100]

    },
    series: [
        {
            symbol: "none",
            data: [],
            type: 'line',
            lineStyle: { // 设置线条的style等
                normal: {
                    color: '#1890ff', // 折线线条颜色:红色
                },
            },
        },
        {
            symbol: "none",
            data: [],
            type: 'line',
            lineStyle: { // 设置线条的style等
                normal: {
                    color: '#99ccff', // 折线线条颜色:红色
                },
            },
        },
    ]
}
